const SCREENSAVER_SCHEMA = 'org.gnome.desktop.screensaver';
+const CROSSFADE_TIME = 300;
+
const BLUR_BRIGHTNESS = 0.55;
const BLUR_RADIUS = 200;
accessible_role: Atk.Role.WINDOW,
style_class: 'login-dialog',
visible: false,
+ reactive: true,
});
parentActor.add_child(this);
+ this._activePage = null;
+
+ let tapAction = new Clutter.TapAction();
+ tapAction.connect('tap', this._showPrompt.bind(this));
+ this.add_action(tapAction);
+
// Background
this._backgroundGroup = new Clutter.Actor();
this.add_child(this._backgroundGroup);
this._clock = new Clock();
stack.add_child(this._clock);
+ this._showClock();
this._authPrompt = new AuthPrompt.AuthPrompt(new Gdm.Client(), AuthPrompt.AuthPromptMode.UNLOCK_ONLY);
this._authPrompt.connect('failed', this._fail.bind(this));
this.connect('destroy', this._onDestroy.bind(this));
}
+ vfunc_key_press_event(keyEvent) {
+ if (this._activePage === this._promptBox ||
+ (this._promptBox && this._promptBox.visible))
+ return Clutter.EVENT_PROPAGATE;
+
+ let unichar = keyEvent.unicode_value;
+
+ this._showPrompt();
+
+ if (GLib.unichar_isgraph(unichar))
+ this.addCharacter(unichar);
+
+ return Clutter.EVENT_PROPAGATE;
+ }
+
_createBackground(monitorIndex) {
let monitor = Main.layoutManager.monitors[monitorIndex];
let widget = new St.Widget({
}
}
+ _showClock() {
+ if (this._activePage === this._clock)
+ return;
+
+ this._activePage = this._clock;
+ this._clock.show();
+
+ this._promptBox.ease({
+ opacity: 0,
+ duration: CROSSFADE_TIME,
+ mode: Clutter.AnimationMode.EASE_OUT_QUAD,
+ onComplete: () => this._promptBox.hide(),
+ });
+
+ this._clock.ease({
+ opacity: 255,
+ duration: CROSSFADE_TIME,
+ mode: Clutter.AnimationMode.EASE_OUT_QUAD,
+ });
+ }
+
+ _showPrompt() {
+ if (this._activePage === this._promptBox)
+ return;
+
+ this._activePage = this._promptBox;
+ this._promptBox.show();
+
+ this._clock.ease({
+ opacity: 0,
+ duration: CROSSFADE_TIME,
+ mode: Clutter.AnimationMode.EASE_OUT_QUAD,
+ onComplete: () => this._clock.hide(),
+ });
+
+ this._promptBox.ease({
+ opacity: 255,
+ duration: CROSSFADE_TIME,
+ mode: Clutter.AnimationMode.EASE_OUT_QUAD,
+ });
+ }
+
_fail() {
this.emit('failed');
}
}
addCharacter(unichar) {
+ this._showPrompt();
this._authPrompt.addCharacter(unichar);
}